import { makeAutoObservable } from 'mobx'
import { queryNoticeDetail } from '../api'
import type { NoticeType } from '../api/interface'

class Store {
    public noticeDetail: Partial<NoticeType> = {}
    /** 专业大类 */
    majorDict: Record<string, string> = {}

    /** 培训级别 */
    levelDict: Record<string, string> = {}
    constructor() {
        makeAutoObservable(this)
    }
    queryDetail = async (id: string) => {
        const res = await queryNoticeDetail(id)
        if (res.data) {
            this.noticeDetail = (res.data as unknown) as NoticeType
        }
    }
}

export default Store
